<html>
<head><meta charset="utf-8"><title>TyVid from projection ty · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/TyVid.20from.20projection.20ty.html">TyVid from projection ty</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244882570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/TyVid%20from%20projection%20ty/near/244882570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/TyVid.20from.20projection.20ty.html#244882570">(Jul 04 2021 at 23:30)</a>:</h4>
<p>I'm trying to create an inference variable (ty::TyVid) from a projection predicate. I'm putting the code inside the predicate registration in rustc_trait_selection::traits::fulfill (this is for never type fallback tracking, FWIW). I tried adding a call to normalize_projection_type, but this seems to be causing unsizing to stop working -- I'm getting an error when compiling libcore. My guess is that the "extra" inference variable is somehow causing problems? But it seems a little surprising...</p>
<div class="codehilite"><pre><span></span><code>error[E0271]: type mismatch resolving `&lt;[closure@library/core/src/fmt/builders.rs:26:22: 29:10] as FnOnce&lt;(&amp;mut dyn Write,)&gt;&gt;::Output == &amp;mut dyn Write`
  --&gt; library/core/src/fmt/builders.rs:26:13
   |
26 |         fmt.wrap_buf(move |buf| {
   |             ^^^^^^^^ expected struct `PadAdapter`, found trait object `dyn Write`
   |
   = note: expected mutable reference `&amp;mut PadAdapter&lt;&#39;buf, &#39;state&gt;`
              found mutable reference `&amp;mut dyn Write`
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>